<?php
/**
 * Created by PhpStorm.
 * User: shan
 * Date: 2016/11/17
 * Time: 15:32
 */

namespace backend\controllers;


use backend\models\BannerSearch;
use yii\base\Controller;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;

class BannerController extends Controller
{
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'actions' => ['index','create','update','delete','view'],
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                ],
            ],
        ];
    }
    public function actionIndex(){
        $searchModel  = new BannerSearch();
        $dataProvider = $searchModel->search(\Yii::$app->request->queryParams);
        return $this->render('index',['dataProvider'=>$dataProvider,'searchModel'=>$searchModel]);
    }
}